# $Id: PKGBUILD 68250 2012-03-20 16:44:31Z schiv $
# Maintainer: Ray Rashif <schiv@archlinux.org>
# Contributor: svoufff <svoufff at gmail dot com>

pkgname=jsampler
_realname=JSampler
pkgver=0.9
pkgrel=2
pkgdesc="LinuxSampler Java GUI"
arch=(any)
url="http://sourceforge.net/projects/jsampler/"
license=('GPL')
depends=('java-runtime' 'linuxsampler')
makedepends=('java-environment' 'apache-ant')
source=(http://downloads.sourceforge.net/$pkgname/$_realname-$pkgver.tar.bz2
        $pkgname.sh
        $pkgname-classic.sh
        $pkgname.desktop
        $pkgname-classic.desktop)
md5sums=('e1915d9c222388caed7b8eac6579ab8a'
         '41fbbd9e6ed85ba0ab1086827dcdda12'
         '88e8129968aa089ec6f24b96d655563b'
         '25fb1cfbbe833a6cf9a02662a77cb43e'
         '186aab16866fecb0579b985195eaeeb0')

build() {
  cd "$srcdir/$_realname-$pkgver"

  ant build-fantasia
  ant build-jsclassic
}

package() {
  cd "$srcdir/$_realname-$pkgver"

  # install java files
  install -Dm644 dist/Fantasia-$pkgver.jar \
    "$pkgdir/usr/share/java/$pkgname/fantasia.jar"
  install -Dm644 dist/JS_Classic-$pkgver.jar \
    "$pkgdir/usr/share/java/$pkgname/js-classic.jar"

  # install shell scripts
  install -Dm755 ../$pkgname.sh \
	  "$pkgdir/usr/bin/$pkgname"
  install -Dm755 ../$pkgname-classic.sh \
    "$pkgdir/usr/bin/$pkgname-classic"

  # install freedesktop.org compatibility
  install -Dm644 res/fantasia/icons/app_icon.png \
    "$pkgdir/usr/share/pixmaps/$pkgname.png"
  install -Dm644 res/js-classic/icons/app-icon.png \
    "$pkgdir/usr/share/pixmaps/$pkgname-classic.png"

  install -Dm644 ../$pkgname.desktop \
    "$pkgdir/usr/share/applications/$pkgname.desktop"
  install -Dm644 ../$pkgname-classic.desktop \
    "$pkgdir/usr/share/applications/$pkgname-classic.desktop"
}

# vim:set ts=2 sw=2 et:
